
function EditLog(val){
window.location.href="ActivityLog.php?ID="+val;
}

function EditLog2(val){
window.location.href="ActivityLog2.php?ID="+val;
}


function EditLog3(val){
window.location.href="ActivityLog3.php?ID="+val;
}


function CheckValue(obj)
{
	if(obj.value == ""){
		obj.value = 0;
	}

}
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) { 
var j = i + alen; 
if (document.cookie.substring(i, j) == arg) 
return getCookieVal (j); 
i = document.cookie.indexOf(" ", i) + 1; 
if (i == 0) break; 
} 
return null; 
}
function openWindow(url)
{
    var w = window.open (url, "win", "height=400,width=400,location=no,menubar=no,resizable,scrollbars=yes,status=no,toolbar=no");
}
function validateLogDate(obj){
if(obj.value=="") return true;

var curdt = new Date();
//alert(curdt);
var today=curdt.getFullYear()+"/"+(curdt.getMonth()+1)+"/"+curdt.getDate();
var lgdate=obj.value;

//setFocusColor(obj);

if(today!=lgdate){
	alert("Todays date = "+today+" and enter date = "+lgdate+" does not match.\nPlease enter todays logdate to enter todays activity.");
	document.formIPP.frmlogdate.focus();
	}else{
		//
	}
}
function setFocusColor(obj){
//alert(obj.style.backgroundColor);
	obj.style.backgroundColor="yellow";
	obj.focus();
	//obj.select();
}
function resetFocusColor(obj){
	if(obj.value != "0" && obj.value != "." && obj.value != "*"  && obj.value != "-"){
	obj.style.backgroundColor="#FF7FFF";
	}else{
	obj.style.backgroundColor="white";
	}
}


function makeAllReadOnlyExceptSubmit()
{
var arrElements = document.all;
	for(var i=0; i<arrElements.length; i++){
	//arrElements[i].disabled=true;
	arrElements[i].readOnly=true;
	if(arrElements[i].type=="button" || arrElements[i].type=="submit"){
	arrElements[i].disabled=true;
	}
	}
}

// Java Document